package cn.laixueit.mapper;

import cn.laixueit.pojo.Easy;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface EasyMapper {

    @Select("select * from easy")
    List<Easy> findall();

    @Insert("insert into easy(id,title,createtime,nums) values(#{id},#{title},#{createtime},#{nums})")
    int add(Easy easy);

    @Select("select * from easy where id = #{id}")
    Easy findById(String id);

    @Update("update easy set title=#{title} ,createtime=#{createtime},nums=#{nums} where id =#{id}")
    void update(Easy easy);

    @Delete("delete from easy where id = #{id}")
    void deleteById(String id);
}
